<template>
  <view class="item-content link-content">
    <view v-for="link in links" 
      :key="link" 
      class="link-item"
      @click="handleClick(link)"
    >
      <text class="link-icon">🔗</text>
      <text class="link-url">{{ link }}</text>
    </view>
  </view>
</template>

<script setup>
defineProps({
  links: {
    type: Array,
    required: true
  }
})

const handleClick = (url) => {
  uni.setClipboardData({
    data: url,
    success: () => {
      uni.showToast({
        title: '链接已复制',
        icon: 'success'
      })
    }
  })
}
</script>

<style lang="scss" scoped>
.link-content {
  .link-item {
    display: flex;
    align-items: center;
    gap: 8rpx;
    padding: 8rpx 0;
    
    .link-icon {
      flex-shrink: 0;
    }
    
    .link-url {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: #409eff;
      font-size: 28rpx;
    }
  }
}
</style>